import { Controller, Get, Query } from '@nestjs/common';
import { RoleService } from './role.service';

@Controller('role')
export class RoleController {
  constructor(private readonly roleService: RoleService) {}
  @Get('/getAllRoles')
  getRoles() {
    return this.roleService.getAllRoles();
  }

  @Get('/getUserRoles')
  getUserRoles(@Query('username') username: string) {
    return this.roleService.findRolesByUsername(username);
  }
}
